package com.aizuda.boot.modules.common.constant.enums;

/**
 * 权限范围类型枚举
 * 
 * @author system
 * @version 1.0
 * @date 2025/1/27
 */
public enum PermissionScopeType {

    ALL("all", "全部"),
    SINGLE("single", "单选"),
    MULTIPLE("multiple", "多选")
    ;

    private final String code;
    private final String description;

    PermissionScopeType(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    /**
     * 根据code获取枚举
     */
    public static PermissionScopeType getByCode(String code) {
        for (PermissionScopeType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
} 